# 统计字符串长度
def my_length(data):
    length = 0
    for x in data:
        print(x)
        length += 1
    return length

def noneTest():
    print('没有return的情况')

result = noneTest()
# 判断是否为None
if not result:
    print(type(result))

num = 200
def action() :
    # num = 500
    # global 设置函数内部的局部变量变成全局变量
    global num
    print(num)
print(num)
action()

money = 10000
def main ():
    print("-------主菜单----")
    print("查询------[输入1]")
    print("存钱------[输入2]")
    print("取钱------[输入3]")
    print("退出------[输入4或其他任意数字]")
# main()
def query():
    global money
    print(f"当前余额为{money}")
def saveing(flag):
    global save
    global money
    if flag :
        save = int(input("请输入存钱数"))
        money += save
    else:
        save = int(input("请输入取钱数"))
        money -= save
    return money

while True:
    main()
    index = input("请输入待办代号")
    if index == "1":
        query()
        continue
    if index == "2":
        saveing(True)
        continue
    if index == "3":
        saveing(False)
        continue
    else :
        print("程序结束了！！！")
        break

